﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using PJ.Data;

namespace PJ.Data.WCF
{
    public abstract class EntityProviderClient<S, D> : ObjectProviderClient<S, D>, IEntityWCFProvider<D>
        where D : BaseEntityData, new()
        where S : class, IEntityWCFProvider<D>
    {
        protected EntityProviderClient() {
        }
        
        protected EntityProviderClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        protected EntityProviderClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        protected EntityProviderClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        protected EntityProviderClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }

        public D GetById(string sessionId, string id, int mode)
        {
            if (id == null || id == "")
                throw new ArgumentNullException();
            return base.Channel.GetById(sessionId, id, mode);
        }

        #region Interface override
        #endregion

    }
}
